
local sessionHttp = class("sessionHttp", z9.sessionBase)

function sessionHttp:ctor(objRequest, funcResp)
    sessionHttp.super.ctor(self, nil)

    self._request = objRequest
    self._response = funcResp 
end 



function sessionHttp:say(str)
    self._response:setHeader("Content-Type","text/plain")
    self._response:appendBody(str)
    self._response:finish("200", "OK")
end 

function sessionHttp:resp(intRet, strErr, tabOther)
    local tabMsg = {}
    tabMsg.mid = self._mid
    tabMsg.ret = intRet
    tabMsg.err = strErr
    if tabOther then
        table.merge(tabMsg, tabOther)
    end
    self:say(z9.json.encode(tabMsg))
end 

return sessionHttp

